<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRepairMaterialsTable extends Migration
{
  /**
   * 维修材料
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('repair_material', function (Blueprint $table) {
      $table->increments('id');
      $table->unsignedSmallInteger('repair_bills_id')->comment('维修单ID');
      $table->unsignedSmallInteger('storehouse_id')->comment('配件ID');
      $table->unsignedSmallInteger('num')->comment('领取数量');
      $table->unsignedSmallInteger('price')->comment('配件售价');
      $table->unsignedSmallInteger('staff_id')->comment('配件领用人');
      $table->text('msg')->nullable()->comment('备注信息');
      $table->timestamps();
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    Schema::dropIfExists('repair_material');
  }
}
